import QtQuick 2.0

Rectangle {
    width: 1080
    height: 160
//    color: "grey"
    gradient: Gradient {
        GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0.5) }
        GradientStop { position: 1.0; color: Qt.rgba(0,0,0,0) }
    }
//    border.color: Qt.rgba(1,1,1,0.4)
//    border.width: 1

    Row{
        x: 67
        spacing: 70
        anchors.verticalCenter: parent.verticalCenter
        Column{
            Text {
                color: "white"
                text: can_manager.speed
                font{
                    family: "Aldrich"
                    pixelSize: 76
                }
            }
            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                color: "white"
                text: "km/h"
                font{
                    family: "Aldrich"
                    pixelSize: 25
                }
            }
        }

        Column{
            Text {
                color: "white"
                text: can_manager.engine_speed
                font{
                    family: "Aldrich"
                    pixelSize: 76
                }
            }
            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                color: "white"
                text: "rpm"
                font{
                    family: "Aldrich"
                    pixelSize: 25
                }
            }
        }
        Text {
            anchors.verticalCenter: parent.verticalCenter
            color: "white"
            text: can_manager.f_gear ? (can_manager.first_gear?"F1":"F2"):(can_manager.n_gear ? "N":can_manager.r_gear ? "R":"P")
            font{
                family: "Aldrich"
                pixelSize: 96
            }
        }
    }

    Row{
        anchors.right: parent.right
        anchors.rightMargin: 15

        spacing: 20

        ImuItem{
            iconSource: "qrc:/loader/imgs/side_loader.png"
            currentAngle: can_manager.euler_x
        }
        ImuItem{
            iconSource: "qrc:/loader/imgs/rear_loader.png"
            currentAngle: can_manager.euler_y
        }
    }
}
